package controllers

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

type AdminController struct {
}

func NewAdmin() *AdminController {
	return &AdminController{}
}
func (_this *AdminController) AddRecord(ctx *gin.Context) {
	ctx.JSON(http.StatusOK, "添加新纪录")
}

func (_this *AdminController) RemoveRecord(ctx *gin.Context) {
	ctx.JSON(http.StatusOK, "删除新纪录")
}

func (_this *AdminController) UpdateRecord(ctx *gin.Context) {
	ctx.JSON(http.StatusOK, "更新新纪录")
}

func (_this *AdminController) QueryRecords(ctx *gin.Context) {
	ctx.JSON(http.StatusOK, "查询新纪录")
}

func (_this *AdminController) Login(ctx *gin.Context) {

}
func (_this *AdminController) Register(ctx *gin.Context) {

}
func (_this *AdminController) SetupRoutes(engine *gin.Engine) {
	admin := engine.RouterGroup.Group("admin")
	{
		admin.GET("add", _this.AddRecord)
		admin.GET("del", _this.RemoveRecord)
		admin.GET("edit", _this.UpdateRecord)
		admin.GET("query", _this.QueryRecords)
	}
}
